package com.hicorp.segment.pojo.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * menu
 *
 * @author wqs
 */
@Data
public class Menu implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private Long parentId;

    private Integer menuOrders;

    private String path;

    private String title;

    private String icon;

    private Date createGmt;

    private Date modifiedGmt;

    @Transient
    private  String fullName;

    @Transient
    private String parentTitle;

    @Transient
    private List<Menu> children;

    @Transient
    private List<BackendApi> menuBackendApis;


    //以下用于搜索的临时字段
    @Transient
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createGmtStart;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @Transient
    private Date createGmtEnd;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @Transient
    private Date modifiedGmtStart;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @Transient
    private Date modifiedGmtEnd;
}